import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Test {
    public static void main2(String[] args) {
        char[] a = new char[10];
        a[0] = 'a';
        System.out.println("=======");
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            String s = in.nextLine();
            func(s);
        }
    }

    private static void func(String s) {
        char[] arr = s.toCharArray();
        char[] newArr = new char[arr.length];

        for (int i = 0; i < arr.length; i++) {
            newArr = new char[arr.length];
            int k = 0;
            for (int j = 0; j < arr.length - 1; j++) {
                if (arr[j] == arr[j + 1]) {
                    j++;
                    continue;
                }
                newArr[k++] = arr[j];
            }
            newArr[k] = arr[arr.length - 1];
            arr = newArr;
        }
        for (int i = 0; i < newArr.length; i++) {
            if (newArr[0] == 0) {
                System.out.println(0);
                return;
            }
            if (newArr[i] == 0) {
                System.out.println();
                return;
            }
            System.out.print(newArr[i]);
        }
        System.out.println();
    }

    public static void main1(String[] args) {
        isSubsequence("nowcoder", "nowcoder");
    }

    public static boolean isSubsequence(String S, String T) {
        // write code here
        Queue<Character> queue = new LinkedList<>();
        char[] arr = S.toCharArray();
        for (int i = 0; i < arr.length; i++) {
            queue.offer(arr[i]);
        }

        for (int i = 0; i < T.length(); i++) {
            char ch = T.charAt(i);
            if (ch == queue.peek()) {
                queue.poll();
            }
            if (queue.isEmpty()) {
                return true;
            }
        }
        return false;
    }

}
